RND_EDGE_GRILL

Overview

Calculate the loss coefficient for a rounded edge grill or perforated plate.

Excel Usage

=RND_EDGE_GRILL(alpha, l, Dh, fd)
  • alpha (float, required): Fraction of grill open to flow (must be 0.3-0.7), [-]
  • l (float, optional, default: null): Thickness of the grill or plate, [m]
  • Dh (float, optional, default: null): Hydraulic diameter of gap in grill, [m]
  • fd (float, optional, default: null): Darcy friction factor, [-]

Returns (float): Loss coefficient K, [-], or error message (str) if input is invalid.

Examples

Example 1: Basic case (alpha=0.4)

Inputs:

alpha
0.4

Excel formula:

=RND_EDGE_GRILL(0.4)

Expected output:

Result
1

Example 2: With friction correction (l, Dh, fd provided)

Inputs:

alpha l Dh fd
0.4 0.15 0.002 0.0185

Excel formula:

=RND_EDGE_GRILL(0.4, 0.15, 0.002, 0.0185)

Expected output:

Result
9.6719

Example 3: Mid-range open area (alpha=0.5)

Inputs:

alpha
0.5

Excel formula:

=RND_EDGE_GRILL(0.5)

Expected output:

Result
0.6

Example 4: Higher alpha (alpha=0.7)

Inputs:

alpha
0.7

Excel formula:

=RND_EDGE_GRILL(0.7)

Expected output:

Result
0.2

Python Code

import micropip
await micropip.install(["fluids"])
from fluids.filters import round_edge_grill as fluids_round_edge_grill

def rnd_edge_grill(alpha, l=None, Dh=None, fd=None):
    """
    Calculate the loss coefficient for a rounded edge grill or perforated plate.

    See: https://fluids.readthedocs.io/fluids.filters.html#fluids.filters.round_edge_grill

    This example function is provided as-is without any representation of accuracy.

    Args:
        alpha (float): Fraction of grill open to flow (must be 0.3-0.7), [-]
        l (float, optional): Thickness of the grill or plate, [m] Default is None.
        Dh (float, optional): Hydraulic diameter of gap in grill, [m] Default is None.
        fd (float, optional): Darcy friction factor, [-] Default is None.

    Returns:
        float: Loss coefficient K, [-], or error message (str) if input is invalid.
    """
    # Validate and convert alpha
    try:
        alpha = float(alpha)
    except (ValueError, TypeError):
        return "Error: Alpha must be a number."

    # Validate alpha range (note: 0.3 to 0.7 for round_edge_grill)
    if alpha <= 0 or alpha > 1:
        return "Error: Alpha must be between 0 and 1."

    # Validate and convert optional parameters
    if l is not None:
        try:
            l = float(l)
        except (ValueError, TypeError):
            return "Error: l must be a number."
        if l <= 0:
            return "Error: l must be positive."

    if Dh is not None:
        try:
            Dh = float(Dh)
        except (ValueError, TypeError):
            return "Error: Dh must be a number."
        if Dh <= 0:
            return "Error: Dh must be positive."

    if fd is not None:
        try:
            fd = float(fd)
        except (ValueError, TypeError):
            return "Error: fd must be a number."
        if fd <= 0:
            return "Error: fd must be positive."

    try:
        result = fluids_round_edge_grill(alpha=alpha, l=l, Dh=Dh, fd=fd)
        if result != result:  # NaN check
            return "nan"
        if result == float('inf'):
            return "inf"
        if result == float('-inf'):
            return "-inf"
        return float(result)
    except Exception as e:
        return f"Error computing round_edge_grill: {str(e)}"

Online Calculator